// 2013-7-29下午02:33:30  net.betou.trade.main.manager.CategoryMng.java

package net.betou.trade.main.manager;

import java.util.List;
import java.util.Map;

import net.betou.common.page.Pagination;
import net.betou.trade.entity.main.AgentAndAdmins;
import net.betou.trade.entity.main.Category;

/**
 * 品种管理
 * @author 叶装装
 */
public interface CategoryMng{

	public Category save( Category bean, AgentAndAdmins admin );
	
	public Category update( Category bean );
	
	public Category deleteById( Integer id );
	
	public Category [ ] deleteByIds( Integer [ ] ids );
	
	public Category findById( Integer id );
	
	public Category findByName( String name );
	
	/**
	 * 系统管理员直接返回ID， 如果不是的话，则查找自己的
	 * @param id
	 * @param selfId
	 * @param system
	 * @return
	 */
	public Category findMyCategory( Integer id, Integer selfId, Boolean system );
	
	public List< Map< String, String > > findListByName( AgentAndAdmins admin, String name );
	
	public boolean categoryExist( String name );
	
	public Pagination getPage( AgentAndAdmins admin, String searchProperty, String searchValue, String orderProperty, String orderDirection, int pageNo, int pageSize );
}
